export const useOtherStyle = (labelWidth, specialValue) => {
  const labelStyle = () => {
    return {
      width: labelWidth + "rpx"
    };
  };

  const valueStyle = head => {
    let specialFieldStyle = {};
    if (specialValue) {
      const v = specialValue.split(",");
      if (v.includes(head.prop)) {
        specialFieldStyle = {
          fontWeight: "bold",
          color: useGlobalStore().basicColor.primary
        };
      }
    }
    return {
      width: `calc(100% - ${labelWidth}rpx)`,
      ...specialFieldStyle
    };
  };

  // 最后一行样式
  const rowLastClass = (key, columns) => {
    if (key === columns.length - 1) return "last-row";
  };

  const setScrollStyle = (height: number) => {
    return setScrollHeight(height);
  };

  return {
    labelStyle,
    valueStyle,
    rowLastClass,
    setScrollStyle
  };
};
